package org.example.controller;

import org.example.entity.Tag;
import org.example.service.TagService;
import org.example.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName TagController
 * @Description TODO
 * @Author yuezhijie
 * @Date 2025年08月14日 19:54
 * @Version 1.0
 */
@RestController
@RequestMapping("tag")
public class TagController {
    @Autowired
    private TagService tagService;
    @GetMapping("{id}")
    public R getTagById(@PathVariable("id") int id) {
        List<Tag> tagById = tagService.getTagById(id);
        return R.ok(tagById);
    }

    @GetMapping("/{ids}/all")
    public R findTagById(@PathVariable("ids") int id) {
        List<Tag> tagById = tagService.findTagById(id);
        return R.ok(tagById);
    }
}
